home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DDJMAG
/
DDJ9005.ZIP
/
BOTTORFF.LST
< prev
next >
Wrap
File List
|
1990-03-23
|
1KB
|
63 lines
_OBJECT SWAPPING_
by Jan Bottorff and Jim Bolland
[Examplσ 1║ Objec⌠ access]
Se⌠ thσ object'≤ toucheΣ bit
iµ objec⌠ no⌠ iε memory
then
Swa≡ objec⌠ in
Updatσ O╘ entry
endif
Ge⌠ thσ object'≤ address
[Examplσ 2║ Thσ aginτ process]
fo≥ "ß fewó O╘ entries
iµ objec⌠ i≤ touched
then
Se⌠ object'≤ agσ t∩ 0
else
iµ object'≤ agσ i≤ to∩ old
then
iµ objec⌠ i≤ dirty
then
writσ objec⌠ t∩ disk
endif
Se⌠ objec⌠ addres≤ iε O╘ to
disδ address
Marδ objec⌠ memor∙ as
"discarded"
else
Incremen⌠ object'≤ age
endif
endif
endfor
[Examplσ 3║ Pseud∩ codσ fo≥ swa≡ areß compaction]
fo≥ eacΦ valiΣ O╘ Entry
savσ objec⌠ heade≥ inf∩ in
O╘ entry
savσ O╨ iε objec⌠ header
endfor
Se⌠ allocatioε pointe≥ t∩ poin⌠ at
thσ star⌠ oµ thσ swa≡ area
fo≥ eacΦ objec⌠ iε thσ swa≡ area
iµ valiΣ object
then
Movσ objec⌠ t∩ curren⌠ ì
allocatioε pointer
Restorσ objec⌠ header
froφ thσ O╘ usinτ saveΣ OP
Se⌠ O╘ addres≤ equa∞ to
allocatioε pointer
AdΣ sizσ oµ objec⌠ to
allocatioε pointer
else
Ski≡ thi≤ object
endif
endfor